function(compile_all_cpp_files target_directory)
    file(GLOB cpp_files "${target_directory}/*.cpp")


    foreach(cpp_file ${cpp_files})
        get_filename_component(target_name ${cpp_file} NAME_WE)
        add_executable(${target_name} ${cpp_file})
        target_link_libraries(${target_name} ceres glog)
        set_target_properties(${target_name} PROPERTIES
                RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
        )
    endforeach()
endfunction()


